package com.guiguli.StringJoiner.for_while;

import java.util.Random;
import java.util.Scanner;

public class Random_ {
    public static void main(String[] args) {
        Random r = new Random();// 随机数对象
        Scanner sc= new Scanner(System.in);
        while(true) {
            int number = r.nextInt(10);//0-9
            int i=sc.nextInt();
            if(i==number){
                System.out.println("猜对了");
                break;
            }
            else{
                System.out.println("猜错了");
            }
        }
    }
}
